<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<div id="box">
			0:0:0
		</div>
		<input type="button" name="" id="" value="开始"onclick="kaishi()" />
		<input type="button" name="" id="" value="暂停"onclick="zanting()" />
		<input type="button" name="" id="" value="清零"onclick="qingling()" />
		<script type="text/javascript">
			var time=0;
			var shi=0;
			var fen=0;
			var miao=0;
			var id=0;
			function qingling () {
				history.go(0)
			}
			function zanting () {
				clearInterval(id)
				id=0;
			}
			function kaishi () {
				if (id==0) {
					id=setInterval(function(){
            	time++;
            	var miao=time%60;
            	var fen=parseInt(time/60)%60;
            	var xiaoshi=parseInt(time/3600);
            	var day=parseInt(time/(3600*24));
            	
            	document.getElementById("box").innerHTML=(+xiaoshi+":"+fen+":"+miao)
            	
            	
            },10)
			
				}
				
			}
            
			
			
			
		</script>
	</body>
</html>
